﻿using System.Collections.Generic;
using Mangosoft.DiceCopy.Presentation.Domain.Contracts;
using Mangosoft.DiceCopy.Presentation.Domain.JobHuntingModuleService;
using Mangosoft.DiceCopy.Presentation.Domain.Models;
using System.Collections.ObjectModel;

namespace Mangosoft.DiceCopy.Presentation.Domain.Handlers {
    public class GetNewsByChannel {
        readonly INewsAgent _newsAgent;

        public GetNewsByChannel(INewsAgent newsAgent) {
            _newsAgent = newsAgent;
        }

        public virtual IEnumerable<NewsModel> Execute(int channel) {
            var newsdata = _newsAgent.GetNewsByChannel(channel);

            return new ReadOnlyCollection<NewsModel>(newsdata);
        }

    }
}
